package y23.Oct;

import java.util.Scanner;

public class Test14 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int num = in.nextInt();
        int num1 = 2, num2 = 2, count = 0;
        for (int i = 2; i < num; i++) {
            if (prime(i)) {
                int j = num - i;
                if(prime(j)){
                    if (count >= (i>j?i-j:j-i) || count == 0) {
                        num1 = i;
                        num2 = j;
                        count = i>j?i-j:j-i;
                    }
                }
            }
        }
        System.out.println(num1);
        System.out.println(num2);
    }

    public static boolean prime(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }
}
